
const captcha =  async (browser) => {
  try {
    const [page] = browser.contexts()[0].pages();
    
    const cdpSession = await page.context().newCDPSession(page);

    await page.goto("https://google.com/recaptcha/api2/demo");

    const result = await cdpSession.send("Captcha.solve", {
      detectTimeout: 50000, // option, default 30s
    });
    console.log(result);
  } catch (err) {
    console.error(err);
  }
};

module.exports = { captcha };